﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace ElingOA6_DSJCJ.BLL
{
    /// <summary>
    /// 友情连接 逻辑类
    /// </summary>
    public class LinkType
    {
        private DAL.LinkType linkTypeDAL = new DAL.LinkType();
        /// <summary>
        /// 构造函数
        /// </summary>
        public LinkType()
        {
        }
         /// <summary>
        /// 获得数据列表
        /// <creator>wangl</creator>
        /// <date>2013-09-09</date>
        /// </summary>
        public List<Model.LinkType> GetAllList(string entityNo)
        {
            DataSet ds = linkTypeDAL.GetAllList(entityNo);
            return DataTableToList(ds.Tables[0]);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<Model.LinkType> DataTableToList(DataTable dt)
        {
            List<Model.LinkType> modelList = new List<Model.LinkType>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                Model.LinkType model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = linkTypeDAL.DataRowToModel(dt.Rows[n]);
                    if (model != null)
                    {
                        modelList.Add(model);
                    }
                }
            }
            return modelList;
        }
    }
}
